<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100%;
            height: 200px;
            border: 1px solid #000;
            /* 3d必须要在父盒子加上 */
            transform-style: preserve-3d;
            /* 视角 */
            /* transform: perspective(10px); */
            perspective: 100px;
        }
        .inner{
            height: 100px;
            width: 100px;
            background-color: pink;
            transition: all 2s;
        }
        .box:hover .inner{
            transform: translateZ(-800px);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="inner"></div>
    </div>
</body>
</html>